namespace QMVnSoft.Opening
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;

    public class FormCDKTLister : FormOpenningLister
    {
        private IContainer components;
        private CDKTDataAccess oMethod;

        public FormCDKTLister()
        {
            this.oMethod = new CDKTDataAccess();
            this.InitializeComponent();
            this.OnRefresh();
        }

        public FormCDKTLister(bool pb_CheckDetailMost) : base(pb_CheckDetailMost)
        {
            this.oMethod = new CDKTDataAccess();
            this.InitializeComponent();
            this.OnRefresh();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x31a, 0x214);
            base.Name = "FormCDKTLister";
            this.Text = "Số dư đầu kỳ tài khoản";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        protected override void OnGenerateColumns()
        {
            object[][] objArray = new object[8][];
            object[] objArray2 = new object[4];
            objArray2[0] = "Tk";
            objArray2[1] = "Tài khoản";
            objArray2[2] = "C";
            objArray[0] = objArray2;
            object[] objArray3 = new object[4];
            objArray3[0] = "Ten_Tk";
            objArray3[1] = "Tên tài khoản";
            objArray3[2] = "C";
            objArray[1] = objArray3;
            objArray[2] = new object[] { "Du_No", "Dư nợ", "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[3] = new object[] { "Du_Co", "Dư có", "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[4] = new object[] { "Du_No_Nt", "Dư nợ ngoại tệ", "N", AppInstance.TextNumericFormat.ForeignAmount };
            objArray[5] = new object[] { "Du_Co_Nt", "Dư có ngoại tệ", "N", AppInstance.TextNumericFormat.ForeignAmount };
            objArray[6] = new object[] { "Du_No0", "Dư nợ đầu năm " + AppInstance.OpeningDateOfSubEnterprice.Year.ToString(), "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[7] = new object[] { "Du_Co0", "Dư có đầu năm " + AppInstance.OpeningDateOfSubEnterprice.Year.ToString(), "N", AppInstance.TextNumericFormat.LocalAmount };
            base.LocalColNames = objArray;
            base.OnGenerateColumns();
        }

        protected override void OnRefresh()
        {
            base.LocalTable = this.oMethod.GetDataTable(AppInstance.Subsidiary);
        }

        protected override void OnShowDetail()
        {
            base.LocalChildForm = new FormCDKT0Lister(true);
            base.OnShowDetail();
        }
    }
}

